ul {
    list-style-type: none; /* 去掉默认圆点 */
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.search-bar {
    padding: 10px;
    background: #f5f5f5;
}

.main-content {
    display: grid;
    grid-template-columns: 250px 300px 1fr;
    flex: 1;
}

.categories, .note-list, .note-editor {
    padding: 20px;
    border-right: 1px solid #eee;
}

.note-list{
    padding: 20px 20px;
}

.note-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.note-list li.active {
    background-color: #e3f2fd;
}

.note-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.note-time {
    font-size: 12px;
    color: #666;
}

#noteTitle {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

#noteContent {
    width: 100%;
    height: calc(100% - 60px);
    padding: 10px;
    border: 1px solid #ddd;
    resize: none;
}

.categories li {
    display: flex;
    justify-content: space-between;
    /* align-items: center; */
    padding: 8px;
    cursor: pointer;
}

.categories li:hover {
    background-color: #f5f5f5;
}

.categories li.active {
    background-color: #e3f2fd;
}

.category-delete {
    color: #ff4444;
    cursor: pointer;
    padding: 0 5px;
}

.category-delete:hover {
    color: #cc0000;
}

mark {
    background-color: #fff3cd;
    padding: 0 2px;
}

#searchInput {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 其他样式省略... */

/* 通用按钮样式 */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 主要按钮 - 用于重要操作如新建笔记 */
.btn-primary {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    width: 100%;
    margin-bottom: 15px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    box-shadow: 0 4px 8px rgba(25,118,210,0.2);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(25,118,210,0.2);
}

.new-button{
    width: 75%;
}

/* 次要按钮 - 用于新建分类等次要操作 */
.btn-secondary {
    background: white;
    color: #1976d2;
    border: 2px solid #e3f2fd;
    width: calc(100% - 20px);
    margin: 10px;
}

.btn-secondary:hover {
    background: #e3f2fd;
    border-color: #1976d2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 按钮图标 */
.btn i {
    font-size: 18px;
    line-height: 1;
}

/* 按钮禁用状态 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 操作按钮容器 */
.action-buttons {
    margin: 10px 0;
    display: flex;
    gap: 10px;
}

/* 搜索框美化 */
.search-bar {
    position: relative;
    padding: 15px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#searchInput {
    width: 100%;
    padding: 10px 15px;
    padding-left: 35px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25,118,210,0.1);
}

/* 搜索图标 */
.search-bar::before {
    content: '🔍';
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

#noteTitle {
    flex: 1;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.save-status {
    font-size: 13px;
    color: #666;
}

.save-status.saving {
    color: #f57c00;
}

.save-status.saved {
    color: #43a047;
}

.save-status.error {
    color: #d32f2f;
}

/* 笔记列表项样式 */
.note-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.note-info {
    flex: 1;
    min-width: 0; /* 防止文本溢出 */
}

.btn-delete {
    opacity: 0;
    padding: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ff4444;
    transition: all 0.2s ease;
}

.note-item:hover .btn-delete {
    opacity: 1;
}

.btn-delete:hover {
    color: #cc0000;
    transform: scale(1.1);
}

/* 提示消息样式 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.toast-success {
    background-color: #43a047;
}

.toast-error {
    background-color: #d32f2f;
}

.toast-fade {
    opacity: 0;
}

/* 优化笔记列表项的样式 */
.note-list li {
    transition: background-color 0.2s ease;
}

.note-list li:hover {
    background-color: #f5f5f5;
}

.note-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 按钮容器样式 */
.button-container {
    padding: 10px 0;
    display: flex;
    margin-left: 20px;
    justify-content: center;
}

/* 分类区域的基础样式 */
.categories {
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    padding: 0;
}

#categoryList {
    padding: 8px 0;
    overflow-y: auto;
    height: calc(100% - 57px); /* 减去header的高度 */
}

/* 分类项容器 */
.category-item {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* 分类内容样式 */
.category-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: transparent;
    position: relative;
}

.category-content:hover {
    background-color: #f0f0f0;
}

/* 分类前缀区域（包含展开/折叠图标） */
.category-prefix {
    display: flex;
    align-items: center;
    margin-right: 8px;
    width: 20px;
}

/* 展开/折叠图标 */
.category-toggle {
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-icon {
    transition: transform 0.2s ease;
    font-style: normal;
    font-size: 12px;
}

/* 分类名称区域 */
.category-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon {
    font-style: normal;
    height: 20px;
}

/* 子分类容器 */
.subcategories-wrapper {
    display: none;
    width: 100%;
}

/* 子分类列表 */
.subcategories {
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
}

/* 子分类缩进 */
.subcategories .category-content {
    padding-left: 32px; /* 二级分类的缩进 */
}

.subcategories .subcategories .category-content {
    padding-left: 52px; /* 三级分类的缩进 */
}

/* 展开状态 */
.category-item.expanded > .category-content .toggle-icon {
    transform: rotate(90deg);
}

.category-item.expanded > .subcategories-wrapper {
    display: block;
    animation: slideDown 0.3s ease;
}

/* 分类操作按钮 */
.category-actions {
    display: none;
    gap: 4px;
}

.category-content:hover .category-actions {
    display: flex;
}

/* 活动状态 */
.category-item.active > .category-content {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* 展开动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按钮样式 */
.btn-icon {
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    border-radius: 4px;
    height: 20px;
}

.btn-icon:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
}

/* 确保分类区域可以滚动 */
.categories {
    overflow-y: auto;
    height: 100%;
    width: 300px;
}

/* 优化滚动条样式 */
.categories::-webkit-scrollbar {
    width: 6px;
}

.categories::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.categories::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.categories::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 分类区域头部样式 */
.categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.categories-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* 调整新建分类按钮样式 */
.categories-header .btn-secondary {
    padding: 6px 12px;
    font-size: 13px;
    margin: 0;
    width: auto;
    height: 32px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    color: #666;
}

.categories-header .btn-secondary:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.categories-header .btn-secondary i {
    font-size: 14px;
    /* margin-right: 4px; */
}

/* 重命名按钮样式 */
.rename-category {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.rename-category:hover {
    opacity: 1;
}

/* 调整操作按钮间距 */
.category-actions {
    display: none;
    gap: 4px;
}

.category-content:hover .category-actions {
    display: flex;
}

/* 按钮图标样式优化 */
.btn-icon i {
    font-style: normal;
    font-size: 14px;
}

/* 提示框样式补充 */
.toast-info {
    background-color: #2196f3;
}

/* 拖拽相关样式 */
.note-item {
    cursor: grab;
}

.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.drop-target {
    background-color: #e3f2fd;
    border: 2px dashed #1976d2;
}

.drop-target > .category-content {
    background-color: transparent;
}

/* 禁止拖放的视觉提示 */
.category-item[data-level="2"] {
    cursor: no-drop;
}

/* 拖拽时的过渡效果 */
.category-item {
    transition: background-color 0.2s ease, border 0.2s ease;
}

/* 优化笔记项的触摸区域 */
.note-info {
    flex: 1;
    min-width: 0;
    padding: 8px;
    touch-action: none; /* 优化触摸设备上的拖拽 */
}
